package cn.strongme.security.api;

import cn.strongme.security.common.util.R;
import cn.strongme.security.model.entity.User;
import cn.strongme.security.service.UserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * description:
 * email: <a href="strongwalter2014@gmail.com">阿水</a>
 *
 * @author 阿水
 * @date 2018/7/28 18:22.
 */

@RestController
@RequestMapping("user")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("list")
    public R<List<User>> findList(User user) {
        QueryWrapper<User> query = new QueryWrapper<>();
        query.setEntity(user);
        return R.okData(userService.list(query));
    }

}
